package cn.tedu.spring.config;

import cn.tedu.spring.di.UserDao;
import cn.tedu.spring.file.Database;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

public class TestSpringConfig {
    public static void main(String[] args) {
        AnnotationConfigApplicationContext context =
                new AnnotationConfigApplicationContext(SpringConfig.class);
        //获取Database
        Database database = context.getBean(Database.class);
        System.out.println(database);
        //获取UserDao
        UserDao userDao = context.getBean(UserDao.class);
        System.out.println(userDao);

    }
}
